package single

import (
	"gitee.com/ichub/goconfig/common/base/baseconfig"
	"gitee.com/ichub/goconfig/common/base/basedto"
	"gitee.com/ichub/goconfig/common/base/baseiface"
	"gitee.com/ichub/goconfig/common/ichublog"
	"github.com/sirupsen/logrus"
)

type SingleEntity struct {
	baseconfig.IchubClientDto

	Id   int
	Name string
}

func NewSingleEntity() *SingleEntity {
	var s = &SingleEntity{}
	s.InitProxy(s)
	return s
}

func (SingleEntity) Autoload() bool {
	return true
}
func (SingleEntity) AutoInject() bool {
	return true
}

func (*SingleEntity) Check() {
	ichublog.InitLogrus()

	var proxy baseiface.IbaseProxy = basedto.NewIchubResult()
	var single, oksingle = proxy.(baseiface.ISingleton)

	logrus.Info("single=", single, oksingle)
	logrus.Info(single.Single())
}
